<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>江西理工大学三江校区 - 电科251班</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* 样式保持不变，与之前相同 */
        :root {
            --primary-color: #0056a6;
            --secondary-color: #ff6b00;
            --accent-color: #ff9800;
            --light-color: #f5f5f5;
            --dark-color: #333;
            --success-color: #4caf50;
            --warning-color: #ffc107;
            --danger-color: #f44336;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.9)), 
                        url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80');
            background-size: cover;
            background-attachment: fixed;
            background-position: center;
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
        }
        
        .container {
            width: 90%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 15px;
        }
        
        /* 头部样式 */
        header {
            background: linear-gradient(135deg, var(--primary-color), #003d7a);
            color: white;
            padding: 15px 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }
        
        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .logo {
            display: flex;
            align-items: center;
        }
        
        .logo i {
            font-size: 2rem;
            margin-right: 10px;
        }
        
        .logo h1 {
            font-size: 1.5rem;
            font-weight: 600;
        }
        
        .logo p {
            font-size: 0.8rem;
            opacity: 0.9;
        }
        
        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
        }
        
        nav ul {
            display: flex;
            list-style: none;
        }
        
        nav li {
            margin-left: 20px;
        }
        
        nav a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s;
            padding: 8px 12px;
            border-radius: 4px;
            white-space: nowrap;
        }
        
        .mr-2 {
            margin-right: 8px;
        }
        
        nav a:hover, nav a.active {
            background-color: rgba(255, 255, 255, 0.2);
        }
        
        /* 用户信息样式 */
        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .user-avatar {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .user-name {
            font-size: 0.9rem;
        }
        
        .logout-btn {
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            font-size: 0.8rem;
            text-decoration: underline;
        }
        
        /* 通知栏样式 */
        .notifications-bar {
            background-color: var(--warning-color);
            color: #333;
            padding: 8px 0;
            text-align: center;
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .notifications-bar .container {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .notifications-bar i {
            margin-right: 8px;
        }
        
        .notifications-bar a {
            color: var(--primary-color);
            text-decoration: none;
            font-weight: 600;
        }
        
        .notifications-bar a:hover {
            text-decoration: underline;
        }
        
        /* 英雄区域样式 */
        .hero {
            background: linear-gradient(rgba(0, 86, 166, 0.7), rgba(0, 61, 122, 0.8)), 
                        url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80');
            background-size: cover;
            background-position: center;
            color: white;
            padding: 80px 0;
            text-align: center;
        }
        
        .hero h2 {
            font-size: 2rem;
            margin-bottom: 15px;
            font-weight: 700;
        }
        
        .hero p {
            font-size: 1.1rem;
            max-width: 700px;
            margin: 0 auto 25px;
        }
        
        .btn {
            display: inline-block;
            background-color: var(--secondary-color);
            color: white;
            padding: 10px 25px;
            border-radius: 30px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s;
            border: none;
            cursor: pointer;
            font-size: 0.95rem;
        }
        
        .btn:hover {
            background-color: #e05c00;
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }
        
        .btn-small {
            padding: 8px 15px;
            font-size: 0.85rem;
        }
        
        .btn-outline {
            background: transparent;
            border: 2px solid var(--primary-color);
            color: var(--primary-color);
        }
        
        .btn-outline:hover {
            background-color: var(--primary-color);
            color: white;
        }
        
        /* 通知区域样式 */
        .notifications-section {
            background-color: rgba(255, 255, 255, 0.95);
            padding: 40px 0;
            border-bottom: 1px solid #eee;
        }
        
        .notifications-container {
            max-width: 800px;
            margin: 0 auto;
        }
        
        .notifications-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .notifications-header h2 {
            color: var(--primary-color);
            font-size: 1.6rem;
        }
        
        .notifications-list {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        
        .notification-item {
            background-color: #f8f9fa;
            border-left: 4px solid var(--primary-color);
            padding: 15px;
            border-radius: 0 5px 5px 0;
            transition: all 0.3s;
        }
        
        .notification-item.important {
            background-color: #fff3cd;
            border-left-color: var(--warning-color);
        }
        
        .notification-item.urgent {
            background-color: #f8d7da;
            border-left-color: var(--danger-color);
        }
        
        .notification-item:hover {
            transform: translateX(5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .notification-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .notification-title {
            font-weight: 600;
            color: var(--dark-color);
        }
        
        .notification-date {
            color: #666;
            font-size: 0.85rem;
        }
        
        .notification-content {
            color: #555;
            line-height: 1.5;
        }
        
        .notification-tag {
            display: inline-block;
            padding: 3px 8px;
            background-color: var(--primary-color);
            color: white;
            border-radius: 3px;
            font-size: 0.75rem;
            margin-right: 8px;
        }
        
        .notification-tag.important {
            background-color: var(--warning-color);
        }
        
        .notification-tag.urgent {
            background-color: var(--danger-color);
        }
        
        /* 发布通知表单 */
        .publish-notification {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            margin-bottom: 30px;
        }
        
        .publish-notification h3 {
            margin-bottom: 15px;
            color: var(--primary-color);
        }
        
        .form-group {
            margin-bottom: 15px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
        }
        
        .form-control {
            width: 100%;
            padding: 10px 15px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 1rem;
            transition: all 0.3s;
        }
        
        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(0, 86, 166, 0.2);
            outline: none;
        }
        
        textarea.form-control {
            min-height: 100px;
            resize: vertical;
        }
        
        select.form-control {
            cursor: pointer;
        }
        
        /* 搜索框样式 */
        .search-container {
            max-width: 500px;
            margin: 0 auto 30px;
            position: relative;
        }
        
        .search-box {
            width: 100%;
            padding: 12px 20px;
            border: 1px solid #ddd;
            border-radius: 25px;
            font-size: 1rem;
            background-color: rgba(255, 255, 255, 0.95);
            transition: all 0.3s;
            padding-left: 45px;
        }
        
        .search-box:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(0, 86, 166, 0.2);
            outline: none;
        }
        
        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #666;
        }
        
        /* 空状态样式 */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: #666;
        }
        
        .empty-state i {
            font-size: 3rem;
            margin-bottom: 15px;
            color: #ccc;
        }
        
        /* 部分样式 */
        section {
            padding: 60px 0;
        }
        
        .section-title {
            text-align: center;
            margin-bottom: 40px;
        }
        
        .section-title h2 {
            font-size: 1.8rem;
            color: var(--dark-color);
            margin-bottom: 15px;
            position: relative;
            display: inline-block;
        }
        
        .section-title h2::after {
            content: '';
            position: absolute;
            width: 70px;
            height: 4px;
            background-color: var(--primary-color);
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            border-radius: 2px;
        }
        
        .section-title p {
            color: #666;
            max-width: 600px;
            margin: 0 auto;
        }
        
        /* 同学录样式 */
        .students-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 20px;
        }
        
        .student-card {
            background-color: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s;
        }
        
        .student-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        }
        
        .student-img {
            height: 180px;
            background-color: var(--light-color);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #999;
            font-size: 2.5rem;
        }
        
        .student-info {
            padding: 15px;
        }
        
        .student-name {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 5px;
        }
        
        .student-nickname {
            color: var(--primary-color);
            font-weight: 500;
            margin-bottom: 8px;
            font-size: 0.9rem;
        }
        
        .student-motto {
            font-style: italic;
            color: #666;
            margin-bottom: 12px;
            border-left: 3px solid var(--secondary-color);
            padding-left: 8px;
            font-size: 0.9rem;
        }
        
        .student-interests {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        
        .interest-tag {
            background-color: var(--light-color);
            padding: 4px 8px;
            border-radius: 20px;
            font-size: 0.75rem;
            color: #555;
        }
        
        /* 学习资料样式 */
        .resources-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .resources-tabs {
            display: flex;
            justify-content: center;
            margin-bottom: 30px;
            border-bottom: 1px solid #ddd;
            flex-wrap: wrap;
        }
        
        .tab-btn {
            padding: 10px 20px;
            background: none;
            border: none;
            font-size: 0.95rem;
            font-weight: 500;
            color: #666;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
        }
        
        .tab-btn.active {
            color: var(--primary-color);
        }
        
        .tab-btn.active::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 3px;
            background-color: var(--primary-color);
            bottom: -1px;
            left: 0;
            border-radius: 3px 3px 0 0;
        }
        
        .resources-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
        }
        
        .resource-item {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s;
            display: flex;
            flex-direction: column;
            position: relative;
        }
        
        .resource-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        
        .resource-item h4 {
            font-size: 1.1rem;
            margin-bottom: 10px;
            color: var(--dark-color);
        }
        
        .resource-item p {
            color: #666;
            margin-bottom: 15px;
            flex-grow: 1;
            font-size: 0.9rem;
        }
        
        .resource-meta {
            display: flex;
            justify-content: space-between;
            color: #888;
            font-size: 0.85rem;
            margin-bottom: 15px;
        }
        
        .resource-type {
            background-color: var(--light-color);
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
        }
        
        .resource-actions {
            display: flex;
            gap: 10px;
            margin-top: 10px;
        }
        
        /* 学习资料编辑表单 */
        .resource-form {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            margin-bottom: 30px;
        }
        
        .resource-form h3 {
            margin-bottom: 15px;
            color: var(--primary-color);
        }
        
        /* 班级墙样式 */
        .wall-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
            max-width: 800px;
            margin: 0 auto;
        }
        
        .wall-tabs {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
            border-bottom: 1px solid #ddd;
            flex-wrap: wrap;
        }
        
        .wall-tab-btn {
            padding: 10px 25px;
            background: none;
            border: none;
            font-size: 0.95rem;
            font-weight: 500;
            color: #666;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
        }
        
        .wall-tab-btn.active {
            color: var(--primary-color);
        }
        
        .wall-tab-btn.active::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 3px;
            background-color: var(--primary-color);
            bottom: -1px;
            left: 0;
            border-radius: 3px 3px 0 0;
        }
        
        .post-form {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            margin-bottom: 30px;
        }
        
        .post {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            margin-bottom: 20px;
        }
        
        .post-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .post-author {
            font-weight: 600;
            color: var(--primary-color);
        }
        
        .post-date {
            color: #888;
            font-size: 0.85rem;
        }
        
        .post-content {
            margin-bottom: 15px;
            line-height: 1.6;
        }
        
        .post-actions {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }
        
        .post-action {
            display: flex;
            align-items: center;
            gap: 5px;
            color: #666;
            background: none;
            border: none;
            cursor: pointer;
            transition: all 0.3s;
            padding: 5px 10px;
            border-radius: 5px;
            font-size: 0.9rem;
        }
        
        .post-action:hover {
            background-color: #f5f5f5;
        }
        
        .post-action.liked {
            color: var(--danger-color);
        }
        
        .anonymous-post .post-author {
            color: #888;
        }
        
        /* 评论区域样式 */
        .comments-section {
            margin-top: 15px;
            border-top: 1px solid #eee;
            padding-top: 15px;
        }
        
        .comment-form {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }
        
        .comment-input {
            flex-grow: 1;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 20px;
            font-size: 0.9rem;
            min-width: 150px;
        }
        
        .comment-input:focus {
            outline: none;
            border-color: var(--primary-color);
        }
        
        .comments-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .comment {
            background-color: #f8f9fa;
            padding: 10px 15px;
            border-radius: 10px;
        }
        
        .comment-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 5px;
            flex-wrap: wrap;
            gap: 5px;
        }
        
        .comment-author {
            font-weight: 500;
            font-size: 0.85rem;
        }
        
        .comment-date {
            color: #888;
            font-size: 0.75rem;
        }
        
        .comment-content {
            font-size: 0.9rem;
            color: #555;
        }
        
        /* 活动样式 */
        .events-timeline {
            max-width: 800px;
            margin: 0 auto;
            position: relative;
        }
        
        .events-timeline::before {
            content: '';
            position: absolute;
            width: 4px;
            height: 100%;
            background-color: var(--primary-color);
            left: 50%;
            transform: translateX(-50%);
            border-radius: 2px;
        }
        
        .event-item {
            width: calc(50% - 40px);
            margin-bottom: 40px;
            position: relative;
        }
        
        .event-item:nth-child(odd) {
            margin-left: auto;
        }
        
        .event-item::before {
            content: '';
            position: absolute;
            width: 20px;
            height: 20px;
            background-color: var(--primary-color);
            border-radius: 50%;
            top: 20px;
        }
        
        .event-item:nth-child(odd)::before {
            left: -50px;
        }
        
        .event-item:nth-child(even)::before {
            right: -50px;
        }
        
        .event-content {
            background-color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .event-date {
            color: var(--primary-color);
            font-weight: 600;
            margin-bottom: 10px;
        }
        
        .event-title {
            font-size: 1.2rem;
            margin-bottom: 10px;
        }
        
        /* 页脚样式 */
        footer {
            background-color: var(--dark-color);
            color: white;
            padding: 50px 0 20px;
        }
        
        .footer-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 30px;
            margin-bottom: 30px;
        }
        
        .footer-column h3 {
            font-size: 1.2rem;
            margin-bottom: 15px;
            position: relative;
            padding-bottom: 8px;
        }
        
        .footer-column h3::after {
            content: '';
            position: absolute;
            width: 40px;
            height: 3px;
            background-color: var(--secondary-color);
            bottom: 0;
            left: 0;
            border-radius: 2px;
        }
        
        .footer-links {
            list-style: none;
        }
        
        .footer-links li {
            margin-bottom: 8px;
        }
        
        .footer-links a {
            color: #bbb;
            text-decoration: none;
            transition: all 0.3s;
            font-size: 0.9rem;
        }
        
        .footer-links a:hover {
            color: white;
            padding-left: 5px;
        }
        
        .social-links {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        
        .social-links a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 35px;
            height: 35px;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            color: white;
            transition: all 0.3s;
        }
        
        .social-links a:hover {
            background-color: var(--primary-color);
            transform: translateY(-5px);
        }
        
        .copyright {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: #bbb;
            font-size: 0.85rem;
        }
        
        /* 模态框样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        
        .modal-content {
            background-color: white;
            border-radius: 10px;
            padding: 25px;
            width: 100%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .modal-title {
            font-size: 1.5rem;
            color: var(--primary-color);
        }
        
        .close-modal {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #666;
        }
        
        /* 登录表单样式 */
        .login-form {
            max-width: 400px;
            margin: 50px auto;
            background-color: white;
            border-radius: 10px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }
        
        .login-form h2 {
            text-align: center;
            margin-bottom: 20px;
            color: var(--primary-color);
        }
        
        /* 数据管理样式 */
        .data-management {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            margin-bottom: 30px;
        }
        
        .data-management h3 {
            margin-bottom: 15px;
            color: var(--primary-color);
        }
        
        .data-actions {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
        }
        
        /* 统计信息样式 */
        .stats-container {
            margin-bottom: 30px;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
        }
        
        .stat-item {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .stat-item h3 {
            font-size: 2rem;
            color: var(--primary-color);
            margin-bottom: 10px;
        }
        
        .stat-item p {
            color: #666;
            font-weight: 500;
        }
        
        /* 文件上传样式 */
        .file-upload {
            border: 2px dashed #ddd;
            border-radius: 10px;
            padding: 20px;
            text-align: center;
            margin-bottom: 15px;
            transition: all 0.3s;
        }
        
        .file-upload:hover {
            border-color: var(--primary-color);
        }
        
        .file-upload i {
            font-size: 2rem;
            color: #ccc;
            margin-bottom: 10px;
        }
        
        .file-info {
            margin-top: 10px;
            font-size: 0.9rem;
            color: #666;
        }
        
        /* 加载动画 */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease-in-out infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* 消息提示样式 */
        .message {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 15px 20px;
            border-radius: 5px;
            color: white;
            font-weight: 500;
            z-index: 2000;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            max-width: 300px;
        }
        
        .message.success {
            background-color: var(--success-color);
        }
        
        .message.error {
            background-color: var(--danger-color);
        }
        
        .message.info {
            background-color: var(--primary-color);
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                text-align: center;
            }
            
            .mobile-menu-btn {
                display: block;
                position: absolute;
                right: 20px;
                top: 15px;
            }
            
            nav {
                width: 100%;
                display: none;
                margin-top: 15px;
            }
            
            nav.active {
                display: block;
            }
            
            nav ul {
                flex-direction: column;
                gap: 10px;
            }
            
            nav li {
                margin-left: 0;
            }
            
            nav a {
                display: block;
                text-align: center;
            }
            
            .hero {
                padding: 60px 0;
            }
            
            .hero h2 {
                font-size: 1.8rem;
            }
            
            .hero p {
                font-size: 1rem;
            }
            
            .events-timeline::before {
                left: 20px;
            }
            
            .event-item {
                width: calc(100% - 60px);
                margin-left: 60px !important;
            }
            
            .event-item::before {
                left: -40px !important;
            }
            
            .wall-tabs {
                flex-direction: column;
            }
            
            .wall-tab-btn {
                width: 100%;
                text-align: center;
            }
            
            .notifications-bar .container {
                flex-direction: column;
                gap: 10px;
            }
            
            .comment-form {
                flex-direction: column;
            }
            
            .resources-header {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .resources-tabs {
                width: 100%;
            }
            
            .tab-btn {
                flex: 1;
                text-align: center;
            }
            
            .students-grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            }
            
            .resources-list {
                grid-template-columns: 1fr;
            }
            
            .data-actions {
                flex-direction: column;
            }
        }
        
        @media (max-width: 480px) {
            .container {
                width: 95%;
            }
            
            .logo h1 {
                font-size: 1.3rem;
            }
            
            .logo p {
                font-size: 0.75rem;
            }
            
            .hero h2 {
                font-size: 1.5rem;
            }
            
            .section-title h2 {
                font-size: 1.5rem;
            }
            
            .students-grid {
                grid-template-columns: 1fr;
            }
            
            .footer-content {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <!-- 登录模态框 -->
    <div class="modal" id="login-modal">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title">用户登录</h3>
                <button class="close-modal">&times;</button>
            </div>
            <form id="login-form">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" id="username" class="form-control" placeholder="请输入用户名" required>
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" id="password" class="form-control" placeholder="请输入密码" required>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn" id="login-submit-btn">登录</button>
                </div>
                <div class="form-group">
                    <p>默认账号: admin/123456 (管理员) 或 student/123456 (学生)</p>
                </div>
            </form>
        </div>
    </div>

    <!-- 头部 -->
    <header>
        <div class="container">
            <div class="header-content">
                <div class="logo">
                    <i class="fas fa-university"></i>
                    <div>
                        <h1>江西理工大学三江校区</h1>
                        <p>电科251班 - 班级网站</p>
                    </div>
                </div>
                <div class="user-info" id="user-info" style="display: none;">
                    <div class="user-avatar">
                        <i class="fas fa-user"></i>
                    </div>
                    <div class="user-name" id="user-name"></div>
                    <button class="logout-btn" id="logout-btn">退出</button>
                </div>
                <button class="mobile-menu-btn">
                    <i class="fas fa-bars"></i>
                </button>
                <nav id="main-nav">
                    <ul>
                        <li><a href="#" class="active"><i class="fas fa-home"></i> 首页</a></li>
                        <li><a href="#notifications"><i class="fas fa-bell"></i> 班级通知</a></li>
                        <li><a href="#students"><i class="fas fa-users"></i> 同学录</a></li>
                        <li><a href="#resources"><i class="fas fa-book"></i> 学习资料</a></li>
                        <li><a href="#wall"><i class="fas fa-comments"></i> 班级墙</a></li>
                        <li><a href="#events"><i class="fas fa-calendar-alt"></i> 班级活动</a></li>
                        <li><a href="ai_assistant.html" style="background-color: #ff6b00; color: white; padding: 12px 20px; border-radius: 8px; font-weight: 600; box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3); transition: all 0.3s ease;"><i class="fas fa-robot mr-2"></i> 智能助手</a></li>
                        <li><a href="#" id="admin-link" style="display: none;"><i class="fas fa-cog"></i> 数据管理</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>

    <!-- 通知栏 -->
    <div class="notifications-bar">
        <div class="container">
            <div>
                <i class="fas fa-bullhorn"></i>
                <span>重要通知：本学期期末考试安排已发布，请同学们及时查看！</span>
            </div>
            <a href="#notifications">查看详情 →</a>
        </div>
    </div>

    <!-- 英雄区域 -->
    <section class="hero">
        <div class="container">
            <h2>欢迎来到江西理工大学三江校区电科251班</h2>
            <p>我们是一个团结友爱、积极向上的班集体，这里记录着我们的青春故事，分享着我们的学习资源，见证着我们的共同成长。</p>
            <a href="#students" class="btn">认识同学们</a>
        </div>
    </section>

    <!-- 班级通知 -->
    <section id="notifications" class="notifications-section">
        <div class="container">
            <div class="notifications-container">
                <div class="notifications-header">
                    <h2><i class="fas fa-bullhorn"></i> 班级通知</h2>
                    <span class="btn" id="mark-all-read">标记全部已读</span>
                </div>
                
                <!-- 发布通知表单 -->
                <div class="publish-notification" id="publish-notification" style="display: none;">
                    <h3>发布新通知</h3>
                    <form id="notification-form">
                        <div class="form-group">
                            <label for="notification-title">通知标题</label>
                            <input type="text" id="notification-title" class="form-control" placeholder="请输入通知标题" required>
                        </div>
                        <div class="form-group">
                            <label for="notification-content">通知内容</label>
                            <textarea id="notification-content" class="form-control" placeholder="请输入通知内容" required></textarea>
                        </div>
                        <div class="form-group">
                            <label for="notification-type">通知类型</label>
                            <select id="notification-type" class="form-control" required>
                                <option value="normal">一般通知</option>
                                <option value="important">重要通知</option>
                                <option value="urgent">紧急通知</option>
                            </select>
                        </div>
                        <button type="submit" class="btn">发布通知</button>
                    </form>
                </div>
                
                <div class="notifications-list" id="notifications-list">
                    <!-- 通知将通过JavaScript动态添加 -->
                </div>
            </div>
        </div>
    </section>

    <!-- 同学录 -->
    <section id="students">
        <div class="container">
            <div class="section-title">
                <h2>同学录</h2>
                <p>认识我们班的每一位成员，了解他们的兴趣和特长</p>
            </div>
            
            <!-- 搜索框 -->
            <div class="search-container">
                <i class="fas fa-search search-icon"></i>
                <input type="text" id="student-search" class="search-box" placeholder="搜索同学姓名、昵称、座右铭或兴趣...">
            </div>
            
            <!-- 空状态 -->
            <div id="students-empty-state" class="empty-state" style="display: none;">
                <i class="fas fa-search"></i>
                <h3>未找到匹配的同学</h3>
                <p>请尝试使用其他关键词搜索</p>
            </div>
            
            <!-- 同学卡片 -->
            <div class="students-grid" id="students-grid">
                <!-- 同学卡片将通过JavaScript动态添加 -->
            </div>
        </div>
    </section>

    <!-- 学习资料 -->
    <section id="resources">
        <div class="container">
            <div class="section-title">
                <h2>学习资料</h2>
                <p>共享学习资源，共同进步</p>
            </div>
            
            <div class="resources-header">
                <div class="search-container">
                    <i class="fas fa-search search-icon"></i>
                    <input type="text" id="resource-search" class="search-box" placeholder="搜索资料名称、科目或描述...">
                </div>
                <button class="btn" id="add-resource-btn">添加学习资料</button>
            </div>
            
            <!-- 空状态 -->
            <div id="resources-empty-state" class="empty-state" style="display: none;">
                <i class="fas fa-search"></i>
                <h3>未找到匹配的学习资料</h3>
                <p>请尝试使用其他关键词搜索</p>
            </div>
            
            <!-- 标签页 -->
            <div class="resources-tabs">
                <button class="tab-btn active" data-category="all">全部</button>
                <button class="tab-btn" data-category="course">课程资料</button>
                <button class="tab-btn" data-category="exam">考试资料</button>
                <button class="tab-btn" data-category="project">项目资料</button>
            </div>
            
            <!-- 资源列表 -->
            <div class="resources-list" id="resources-list">
                <!-- 资源将通过JavaScript动态添加 -->
            </div>
        </div>
    </section>

    <!-- 班级墙 -->
    <section id="wall">
        <div class="container">
            <div class="section-title">
                <h2>班级墙</h2>
                <p>分享你的想法，记录班级生活的点滴</p>
            </div>
            
            <div class="wall-tabs">
                <button class="wall-tab-btn active" data-wall="real">实名班级墙</button>
                <button class="wall-tab-btn" data-wall="anonymous">匿名吐槽墙</button>
            </div>
            
            <div class="wall-container">
                <!-- 发布表单 -->
                <div class="post-form">
                    <div class="form-group">
                        <label for="post-author">姓名/昵称</label>
                        <input type="text" id="post-author" class="form-control" placeholder="在实名墙请输入真实姓名">
                    </div>
                    <div class="form-group">
                        <label for="post-content">内容</label>
                        <textarea id="post-content" class="form-control" placeholder="分享你的想法..."></textarea>
                    </div>
                    <button id="submit-post" class="btn">发布</button>
                </div>
                
                <!-- 帖子列表 -->
                <div id="posts-container">
                    <!-- 帖子将通过JavaScript动态添加 -->
                </div>
            </div>
        </div>
    </section>

    <!-- 班级活动 -->
    <section id="events">
        <div class="container">
            <div class="section-title">
                <h2>班级活动</h2>
                <p>记录我们一起度过的美好时光</p>
            </div>
            
            <div class="events-timeline">
                <div class="event-item">
                    <div class="event-content">
                        <div class="event-date">2023年9月</div>
                        <h3 class="event-title">新学期班会</h3>
                        <p>新学期开始，班主任主持召开了第一次班会，明确了本学期的学习目标和班级规划。</p>
                    </div>
                </div>
                
                <div class="event-item">
                    <div class="event-content">
                        <div class="event-date">2023年10月</div>
                        <h3 class="event-title">秋游活动</h3>
                        <p>班级组织了一次秋游活动，前往三江校区附近的公园欣赏秋色，增进了同学之间的友谊。</p>
                    </div>
                </div>
                
                <div class="event-item">
                    <div class="event-content">
                        <div class="event-date">2023年11月</div>
                        <h3 class="event-title">学术讲座</h3>
                        <p>邀请了行业专家为同学们做了一场关于人工智能前沿技术的讲座。</p>
                    </div>
                </div>
                
                <div class="event-item">
                    <div class="event-content">
                        <div class="event-date">2023年12月</div>
                        <h3 class="event-title">元旦晚会</h3>
                        <p>班级举办了元旦晚会，同学们表演了精彩的节目，共同迎接新年的到来。</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 数据管理 -->
    <section id="data-management" style="display: none;">
        <div class="container">
            <div class="section-title">
                <h2>数据管理</h2>
                <p>管理员功能 - 管理班级数据</p>
            </div>
            
            <!-- 统计信息 -->
            <div class="stats-container" id="stats-container">
                <!-- 统计信息将通过JavaScript动态添加 -->
            </div>
            
            <!-- 数据管理 -->
            <div class="data-management">
                <h3>数据导入/导出</h3>
                <div class="data-actions">
                    <button class="btn" id="export-data-btn">导出数据</button>
                    <button class="btn" id="import-data-btn">导入数据</button>
                    <input type="file" id="import-file" accept=".json" style="display: none;">
                </div>
            </div>
            
            <!-- 通知推送 -->
            <div class="data-management">
                <h3>通知推送</h3>
                <div class="form-group">
                    <label for="push-title">推送标题</label>
                    <input type="text" id="push-title" class="form-control" placeholder="请输入推送标题">
                </div>
                <div class="form-group">
                    <label for="push-body">推送内容</label>
                    <textarea id="push-body" class="form-control" placeholder="请输入推送内容"></textarea>
                </div>
                <button class="btn" id="send-push-btn">发送推送通知</button>
            </div>
        </div>
    </section>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-column">
                    <h3>关于我们</h3>
                    <p>江西理工大学三江校区电科251班是一个优秀班集体，我们团结友爱，积极向上，共同成长。</p>
                    <div class="social-links">
                        <a href="#"><i class="fab fa-weixin"></i></a>
                        <a href="#"><i class="fab fa-qq"></i></a>
                        <a href="#"><i class="fab fa-weibo"></i></a>
                        <a href="#"><i class="fab fa-github"></i></a>
                    </div>
                </div>
                
                <div class="footer-column">
                    <h3>快速链接</h3>
                    <ul class="footer-links">
                        <li><a href="#">首页</a></li>
                        <li><a href="#notifications">班级通知</a></li>
                        <li><a href="#students">同学录</a></li>
                        <li><a href="#resources">学习资料</a></li>
                        <li><a href="#wall">班级墙</a></li>
                        <li><a href="#events">班级活动</a></li>
                    </ul>
                </div>
                
                <div class="footer-column">
                    <h3>联系我们</h3>
                    <ul class="footer-links">
                        <li><i class="fas fa-map-marker-alt"></i> 江西理工大学三江校区</li>
                        <li><i class="fas fa-envelope"></i> dianke251@jxust.edu.cn</li>
                        <li><i class="fas fa-phone"></i> 0797-831-XXXX</li>
                    </ul>
                </div>
            </div>
            
            <div class="copyright">
                <p>&copy; 2023 江西理工大学三江校区电科251班 - 班级网站. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <!-- 学习资料编辑模态框 -->
    <div class="modal" id="resource-modal">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="resource-modal-title">添加学习资料</h3>
                <button class="close-modal">&times;</button>
            </div>
            <form id="resource-form">
                <input type="hidden" id="resource-id">
                <div class="form-group">
                    <label for="resource-name">资料名称</label>
                    <input type="text" id="resource-name" class="form-control" placeholder="请输入资料名称" required>
                </div>
                <div class="form-group">
                    <label for="resource-description">资料描述</label>
                    <textarea id="resource-description" class="form-control" placeholder="请输入资料描述" required></textarea>
                </div>
                <div class="form-group">
                    <label for="resource-subject">科目</label>
                    <input type="text" id="resource-subject" class="form-control" placeholder="请输入科目" required>
                </div>
                <div class="form-group">
                    <label for="resource-uploader">上传者</label>
                    <input type="text" id="resource-uploader" class="form-control" placeholder="请输入上传者姓名" required>
                </div>
                <div class="form-group">
                    <label for="resource-category">资料类型</label>
                    <select id="resource-category" class="form-control" required>
                        <option value="course">课程资料</option>
                        <option value="exam">考试资料</option>
                        <option value="project">项目资料</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="resource-file">上传文件</label>
                    <div class="file-upload" id="file-upload-area">
                        <i class="fas fa-cloud-upload-alt"></i>
                        <p>点击或拖拽文件到此处上传</p>
                        <input type="file" id="resource-file" style="display: none;">
                    </div>
                    <div class="file-info" id="file-info"></div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn" id="resource-submit-btn">保存资料</button>
                    <button type="button" class="btn btn-outline" id="resource-cancel-btn">取消</button>
                </div>
            </form>
        </div>
    </div>

    <script>
        // 在DOMContentLoaded事件中添加功能初始化
        document.addEventListener('DOMContentLoaded', function() {
            // 初始化用户认证
            setupAuth();
            
            // 初始化移动端菜单
            setupMobileMenu();
            
            // 初始化搜索功能
            setupSearch();
            
            // 初始化标签页功能
            setupTabs();
            
            // 初始化班级墙功能
            setupWall();
            
            // 初始化通知功能
            setupNotifications();
            
            // 初始化学习资料功能
            setupResources();
            
            // 初始化数据管理功能
            setupDataManagement();
            
            // 初始化通知推送功能
            setupPushNotifications();
            
            // 平滑滚动
            setupSmoothScroll();
            
            // 请求通知权限
            requestNotificationPermission();
            
            // 加载示例数据
            loadSampleData();
            
            // 加载真实同学数据
            loadRealStudentData();
        });
        
        // 显示消息提示
        function showMessage(message, type = 'success') {
            const messageEl = document.createElement('div');
            messageEl.className = `message ${type}`;
            messageEl.textContent = message;
            
            document.body.appendChild(messageEl);
            
            setTimeout(() => {
                messageEl.remove();
            }, 3000);
        }
        
        // 加载真实同学数据
        function loadRealStudentData() {
            const studentsGrid = document.getElementById('students-grid');
            
            // 从Excel数据中提取同学信息
            const students = [
                { name: '袁聪', nickname: '灵喵祈仙', motto: '无', interests: '无' },
                { name: '禹嘉盛', nickname: '无', motto: '无', interests: '篮球，游戏' },
                { name: '郭浩宇', nickname: '', motto: '路漫漫其修远兮，吾将上下而求索', interests: '硬笔书法' },
                { name: '江新远', nickname: '江新远', motto: '天空属于哈夫克', interests: '打球' },
                { name: '颜旻钰', nickname: '大旻', motto: '只要我脸皮足够厚，我就不会自我内耗', interests: '美术，唱歌，舞蹈，下棋' },
                { name: '管泽政', nickname: '', motto: '。。。', interests: '足球，篮球' },
                { name: '王梓宸', nickname: '无', motto: '天才', interests: '打羽毛球' },
                { name: '付思喆', nickname: '', motto: '6', interests: '羽毛球' },
                { name: '陈语晗', nickname: '', motto: '冲冲冲', interests: '吃饭睡觉打游戏' },
                { name: '肖雄会', nickname: '', motto: '悟以往之不谏，知来者之可追', interests: '打羽毛球' },
                { name: '胡佳', nickname: '', motto: '满怀希望才会所向披靡', interests: '唱歌，看小说' },
                { name: '谭鑫玥', nickname: '', motto: '天蝎座', interests: '看小说，听音乐（特别是音乐剧），独处发呆' },
                { name: '徐淑媛', nickname: '无', motto: '无', interests: '画画，动漫阅读，听歌' },
                { name: '鄢迪文', nickname: '', motto: '月光如鱼', interests: '羽毛球' },
                { name: '谢业飞', nickname: '', motto: '活着就行', interests: '上网' },
                { name: '万景辉', nickname: '辉辉 小辉辉', motto: '悟已往之不谏，知来者之可追。', interests: '乒乓球 听周杰伦' },
                { name: '黄耀明', nickname: '', motto: '把每一个脚步，都踩成未来的路标。', interests: '羽毛球，篮球' },
                { name: '邱蕾', nickname: '', motto: '追风赶月莫停留，平芜尽处是春山', interests: '画画，看书' },
                { name: '汪国童', nickname: '', motto: '。', interests: '听歌' },
                { name: '郭翱', nickname: '', motto: '拳向更强者', interests: '王者荣耀' },
                { name: '余铭玥', nickname: '小余', motto: '无', interests: '看综艺 打乒乓球' },
                { name: '王文倩', nickname: 'muse', motto: 'Fighting！', interests: '看比赛羽毛球' },
                { name: '郑旖姗', nickname: '蒲天', motto: '他山之石，可以攻玉', interests: '看小说' },
                { name: '李康伟', nickname: '塵谙', motto: '无', interests: '硬笔书法' },
                { name: '邓莎莎', nickname: '', motto: '各有归舟各有渡口', interests: '唱歌' },
                { name: '谭晶', nickname: '谭品', motto: '发光不是太阳的权利，你也可以', interests: '画画，拍照' },
                { name: '邹天睿', nickname: '无', motto: '活着', interests: '篮球，乒乓' },
                { name: '谢立成', nickname: '谢立成', motto: '联合起来', interests: '打球健身玩游戏' },
                { name: '颜晨旭', nickname: '网名：YUkioail', motto: '不如妈妈生的，有的人写上名字就是满分', interests: '绘画，打游戏' },
                { name: '麦志威', nickname: '', motto: '长风破浪会有时，直挂云帆济沧海', interests: '足球，游戏' },
                { name: '杨成', nickname: '', motto: '一个真正的人', interests: '看小说' },
                { name: '尹建程', nickname: '', motto: '休恋逝水', interests: '打羽毛球' },
                { name: '唐琪琪', nickname: 'tqq', motto: '我喜欢睡觉', interests: '画画' },
                { name: '钟锦鸿', nickname: '钟教', motto: '遇事不决可问春风春风不语即随本心', interests: '打篮球打乒乓球' },
                { name: '雷伊扬', nickname: '一一', motto: '道阻且长，行则将至', interests: '看小说睡觉' },
                { name: '苟明伟', nickname: '流星', motto: '遇事不决，可问春风', interests: '游戏' },
                { name: '肖璐', nickname: '无', motto: '相信相信的力量', interests: '跳舞' },
                { name: '刘涛', nickname: '无', motto: '无', interests: '爱看小说' },
                { name: '郭浩天', nickname: '随心.', motto: '生命如蜉蝣，且行且惜.', interests: '玩游戏（三角洲行动，永劫无间）' }
            ];
            
            // 清空示例数据
            studentsGrid.innerHTML = '';
            
            // 渲染真实同学数据
            students.forEach(student => {
                const studentCard = document.createElement('div');
                studentCard.className = 'student-card';
                
                // 处理兴趣标签
                let interestsHtml = '';
                if (student.interests && student.interests !== '无') {
                    const interests = student.interests.split(/[，,]/).map(i => i.trim());
                    interestsHtml = interests.map(interest => 
                        `<span class="interest-tag">${interest}</span>`
                    ).join('');
                }
                
                studentCard.innerHTML = `
                    <div class="student-img">
                        <i class="fas fa-user"></i>
                    </div>
                    <div class="student-info">
                        <h3 class="student-name">${student.name}</h3>
                        <p class="student-nickname">昵称: ${student.nickname || '无'}</p>
                        <p class="student-motto">座右铭: ${student.motto || '无'}</p>
                        <div class="student-interests">
                            ${interestsHtml || '<span class="interest-tag">暂无兴趣</span>'}
                        </div>
                    </div>
                `;
                
                studentsGrid.appendChild(studentCard);
            });
        }
        
        // 用户认证功能
        function setupAuth() {
            const loginModal = document.getElementById('login-modal');
            const loginForm = document.getElementById('login-form');
            const userInfo = document.getElementById('user-info');
            const userName = document.getElementById('user-name');
            const logoutBtn = document.getElementById('logout-btn');
            const adminLink = document.getElementById('admin-link');
            const publishNotification = document.getElementById('publish-notification');
            
            // 检查本地存储中是否有用户信息
            const currentUser = JSON.parse(localStorage.getItem('currentUser'));
            
            if (currentUser) {
                showUserInfo(currentUser);
            } else {
                showLoginModal();
            }
            
            // 登录表单提交
            loginForm.addEventListener('submit', function(e) {
                e.preventDefault();
                
                const username = document.getElementById('username').value;
                const password = document.getElementById('password').value;
                
                // 简单验证
                const users = JSON.parse(localStorage.getItem('users')) || [
                    {username: 'admin', password: '123456', role: 'admin', name: '管理员'},
                    {username: 'student', password: '123456', role: 'student', name: '学生'}
                ];
                
                const user = users.find(u => u.username === username && u.password === password);
                
                if (user) {
                    localStorage.setItem('currentUser', JSON.stringify(user));
                    showUserInfo(user);
                    loginModal.style.display = 'none';
                    showMessage('登录成功！', 'success');
                } else {
                    showMessage('用户名或密码错误！', 'error');
                }
            });
            
            // 退出登录
            logoutBtn.addEventListener('click', function() {
                localStorage.removeItem('currentUser');
                userInfo.style.display = 'none';
                adminLink.style.display = 'none';
                publishNotification.style.display = 'none';
                document.getElementById('data-management').style.display = 'none';
                showLoginModal();
                showMessage('已退出登录', 'info');
            });
            
            // 显示用户信息
            function showUserInfo(user) {
                userInfo.style.display = 'flex';
                userName.textContent = user.name;
                
                // 如果是管理员，显示管理功能
                if (user.role === 'admin') {
                    adminLink.style.display = 'block';
                    publishNotification.style.display = 'block';
                    document.getElementById('data-management').style.display = 'block';
                }
            }
            
            // 显示登录模态框
            function showLoginModal() {
                loginModal.style.display = 'flex';
            }
            
            // 关闭模态框
            const closeModalBtn = document.querySelector('.close-modal');
            closeModalBtn.addEventListener('click', function() {
                loginModal.style.display = 'none';
            });
            
            // 点击模态框外部关闭
            window.addEventListener('click', function(e) {
                if (e.target === loginModal) {
                    loginModal.style.display = 'none';
                }
            });
        }
        
        // 移动端菜单功能
        function setupMobileMenu() {
            const menuBtn = document.querySelector('.mobile-menu-btn');
            const nav = document.getElementById('main-nav');
            
            if (menuBtn && nav) {
                menuBtn.addEventListener('click', function() {
                    nav.classList.toggle('active');
                });
                
                // 点击菜单项后关闭菜单
                const navLinks = nav.querySelectorAll('a');
                navLinks.forEach(link => {
                    link.addEventListener('click', function() {
                        nav.classList.remove('active');
                    });
                });
            }
        }
        
        // 搜索功能
        function setupSearch() {
            // 同学录搜索
            const studentSearch = document.getElementById('student-search');
            if (studentSearch) {
                studentSearch.addEventListener('input', function() {
                    const searchTerm = this.value.toLowerCase();
                    filterStudents(searchTerm);
                });
            }
            
            // 学习资料搜索
            const resourceSearch = document.getElementById('resource-search');
            if (resourceSearch) {
                resourceSearch.addEventListener('input', function() {
                    const searchTerm = this.value.toLowerCase();
                    filterResources(searchTerm);
                });
            }
        }
        
        // 过滤同学
        function filterStudents(searchTerm) {
            const studentCards = document.querySelectorAll('.student-card');
            let hasResults = false;
            
            studentCards.forEach(card => {
                const name = card.querySelector('.student-name').textContent.toLowerCase();
                const nickname = card.querySelector('.student-nickname').textContent.toLowerCase();
                const motto = card.querySelector('.student-motto').textContent.toLowerCase();
                const interests = Array.from(card.querySelectorAll('.interest-tag'))
                    .map(tag => tag.textContent.toLowerCase())
                    .join(' ');
                
                const matches = name.includes(searchTerm) || 
                              nickname.includes(searchTerm) || 
                              motto.includes(searchTerm) || 
                              interests.includes(searchTerm);
                
                card.style.display = matches ? 'block' : 'none';
                if (matches) hasResults = true;
            });
            
            // 显示/隐藏空状态
            const emptyState = document.getElementById('students-empty-state');
            if (emptyState) {
                emptyState.style.display = hasResults ? 'none' : 'block';
            }
        }
        
        // 过滤学习资料
        function filterResources(searchTerm) {
            const resourceItems = document.querySelectorAll('.resource-item');
            let hasResults = false;
            
            resourceItems.forEach(item => {
                const name = item.querySelector('h4').textContent.toLowerCase();
                const subject = item.querySelector('.resource-meta').textContent.toLowerCase();
                const description = item.querySelector('p').textContent.toLowerCase();
                
                const matches = name.includes(searchTerm) || 
                              subject.includes(searchTerm) || 
                              description.includes(searchTerm);
                
                item.style.display = matches ? 'flex' : 'none';
                if (matches) hasResults = true;
            });
            
            // 显示/隐藏空状态
            const emptyState = document.getElementById('resources-empty-state');
            if (emptyState) {
                emptyState.style.display = hasResults ? 'none' : 'block';
            }
        }
        
        // 标签页功能
        function setupTabs() {
            const tabBtns = document.querySelectorAll('.tab-btn');
            
            tabBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    // 移除所有活动状态
                    tabBtns.forEach(b => b.classList.remove('active'));
                    
                    // 添加当前活动状态
                    this.classList.add('active');
                    
                    // 获取类别
                    const category = this.getAttribute('data-category');
                    
                    // 过滤资源
                    filterResourcesByCategory(category);
                });
            });
        }
        
        // 按类别过滤资源
        function filterResourcesByCategory(category) {
            const resourceItems = document.querySelectorAll('.resource-item');
            
            resourceItems.forEach(item => {
                const itemCategory = item.getAttribute('data-category');
                
                if (category === 'all' || category === itemCategory) {
                    item.style.display = 'flex';
                } else {
                    item.style.display = 'none';
                }
            });
        }
        
        // 班级墙功能
        function setupWall() {
            let currentWallType = 'real'; // 默认显示实名墙
            
            // 切换墙类型
            const wallTabBtns = document.querySelectorAll('.wall-tab-btn');
            wallTabBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    // 移除所有活动状态
                    wallTabBtns.forEach(b => b.classList.remove('active'));
                    
                    // 添加当前活动状态
                    this.classList.add('active');
                    
                    // 更新当前墙类型
                    currentWallType = this.getAttribute('data-wall');
                    
                    // 更新表单提示
                    updateFormHint();
                    
                    // 重新加载帖子
                    loadPosts();
                });
            });
            
            // 发布帖子
            const submitBtn = document.getElementById('submit-post');
            if (submitBtn) {
                submitBtn.addEventListener('click', function() {
                    const authorInput = document.getElementById('post-author');
                    const contentInput = document.getElementById('post-content');
                    
                    const author = authorInput.value.trim();
                    const content = contentInput.value.trim();
                    
                    if (!content) {
                        showMessage('请输入帖子内容！', 'error');
                        return;
                    }
                    
                    // 如果是实名墙，需要验证姓名
                    if (currentWallType === 'real' && !author) {
                        showMessage('实名墙请输入您的姓名！', 'error');
                        return;
                    }
                    
                    // 创建新帖子
                    createPost({
                        id: Date.now(),
                        author: currentWallType === 'anonymous' ? '匿名用户' : author,
                        content: content,
                        date: new Date(),
                        likes: 0,
                        isLiked: false,
                        wallType: currentWallType,
                        comments: []
                    });
                    
                    // 清空表单
                    authorInput.value = '';
                    contentInput.value = '';
                    
                    // 保存到本地存储
                    savePostToLocalStorage({
                        id: Date.now(),
                        author: currentWallType === 'anonymous' ? '匿名用户' : author,
                        content: content,
                        date: new Date(),
                        likes: 0,
                        isLiked: false,
                        wallType: currentWallType,
                        comments: []
                    });
                    
                    showMessage('帖子发布成功！', 'success');
                });
            }
            
            // 更新表单提示
            function updateFormHint() {
                const authorInput = document.getElementById('post-author');
                if (currentWallType === 'real') {
                    authorInput.placeholder = '请输入真实姓名';
                } else {
                    authorInput.placeholder = '匿名用户将显示为"匿名用户"';
                }
            }
            
            // 加载帖子
            function loadPosts() {
                const postsContainer = document.getElementById('posts-container');
                postsContainer.innerHTML = '';
                
                // 从本地存储获取帖子
                const posts = getPostsFromLocalStorage();
                
                // 过滤当前墙类型的帖子
                const filteredPosts = posts.filter(post => post.wallType === currentWallType);
                
                // 按时间倒序排列
                filteredPosts.sort((a, b) => new Date(b.date) - new Date(a.date));
                
                // 渲染帖子
                filteredPosts.forEach(post => {
                    createPost(post);
                });
            }
            
            // 创建帖子DOM元素
            function createPost(post) {
                const postsContainer = document.getElementById('posts-container');
                
                const postElement = document.createElement('div');
                postElement.className = `post ${post.wallType === 'anonymous' ? 'anonymous-post' : ''}`;
                postElement.setAttribute('data-id', post.id);
                
                const date = new Date(post.date);
                const formattedDate = `${date.getFullYear()}-${(date.getMonth()+1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
                
                postElement.innerHTML = `
                    <div class="post-header">
                        <span class="post-author">${post.author}</span>
                        <span class="post-date">${formattedDate}</span>
                    </div>
                    <div class="post-content">${post.content}</div>
                    <div class="post-actions">
                        <button class="post-action ${post.isLiked ? 'liked' : ''}" data-action="like">
                            <i class="fas fa-heart"></i>
                            <span>${post.likes}</span>
                        </button>
                        <button class="post-action" data-action="comment">
                            <i class="fas fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="post-action" data-action="delete">
                            <i class="fas fa-trash"></i>
                            <span>删除</span>
                        </button>
                    </div>
                    <div class="comments-section" style="display: none;">
                        <div class="comment-form">
                            <input type="text" class="comment-input" placeholder="写下你的评论...">
                            <button class="btn btn-small add-comment">发布</button>
                        </div>
                        <div class="comments-list">
                            ${renderComments(post.comments)}
                        </div>
                    </div>
                `;
                
                // 添加到容器
                postsContainer.appendChild(postElement);
                
                // 添加事件监听器
                const likeBtn = postElement.querySelector('[data-action="like"]');
                likeBtn.addEventListener('click', function() {
                    toggleLike(post.id);
                });
                
                const commentBtn = postElement.querySelector('[data-action="comment"]');
                commentBtn.addEventListener('click', function() {
                    const commentsSection = postElement.querySelector('.comments-section');
                    commentsSection.style.display = commentsSection.style.display === 'none' ? 'block' : 'none';
                });
                
                const deleteBtn = postElement.querySelector('[data-action="delete"]');
                deleteBtn.addEventListener('click', function() {
                    deletePost(post.id);
                });
                
                const addCommentBtn = postElement.querySelector('.add-comment');
                addCommentBtn.addEventListener('click', function() {
                    const commentInput = postElement.querySelector('.comment-input');
                    const commentText = commentInput.value.trim();
                    
                    if (commentText) {
                        addComment(post.id, commentText);
                        commentInput.value = '';
                    }
                });
            }
            
            // 渲染评论
            function renderComments(comments) {
                if (!comments || comments.length === 0) {
                    return '<p class="empty-comment">暂无评论</p>';
                }
                
                return comments.map(comment => {
                    const date = new Date(comment.date);
                    const formattedDate = `${date.getFullYear()}-${(date.getMonth()+1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
                    
                    return `
                        <div class="comment">
                            <div class="comment-header">
                                <span class="comment-author">${comment.author}</span>
                                <span class="comment-date">${formattedDate}</span>
                            </div>
                            <div class="comment-content">${comment.content}</div>
                        </div>
                    `;
                }).join('');
            }
            
            // 点赞/取消点赞
            function toggleLike(postId) {
                const posts = getPostsFromLocalStorage();
                const postIndex = posts.findIndex(post => post.id === postId);
                
                if (postIndex !== -1) {
                    if (posts[postIndex].isLiked) {
                        posts[postIndex].likes--;
                        posts[postIndex].isLiked = false;
                    } else {
                        posts[postIndex].likes++;
                        posts[postIndex].isLiked = true;
                    }
                    
                    // 保存到本地存储
                    localStorage.setItem('classWallPosts', JSON.stringify(posts));
                    
                    // 重新加载帖子
                    loadPosts();
                }
            }
            
            // 添加评论
            function addComment(postId, commentText) {
                const posts = getPostsFromLocalStorage();
                const postIndex = posts.findIndex(post => post.id === postId);
                
                if (postIndex !== -1) {
                    if (!posts[postIndex].comments) {
                        posts[postIndex].comments = [];
                    }
                    
                    // 获取评论者名称
                    let commentAuthor = '匿名用户';
                    if (posts[postIndex].wallType === 'real') {
                        // 在实际应用中，这里应该获取当前登录用户的姓名
                        commentAuthor = '同学';
                    }
                    
                    posts[postIndex].comments.push({
                        id: Date.now(),
                        author: commentAuthor,
                        content: commentText,
                        date: new Date()
                    });
                    
                    // 保存到本地存储
                    localStorage.setItem('classWallPosts', JSON.stringify(posts));
                    
                    // 重新加载帖子
                    loadPosts();
                }
            }
            
            // 删除帖子
            function deletePost(postId) {
                if (confirm('确定要删除这条帖子吗？')) {
                    const posts = getPostsFromLocalStorage();
                    const filteredPosts = posts.filter(post => post.id !== postId);
                    
                    // 保存到本地存储
                    localStorage.setItem('classWallPosts', JSON.stringify(filteredPosts));
                    
                    // 重新加载帖子
                    loadPosts();
                    
                    showMessage('帖子删除成功！', 'success');
                }
            }
            
            // 从本地存储获取帖子
            function getPostsFromLocalStorage() {
                const postsJSON = localStorage.getItem('classWallPosts');
                return postsJSON ? JSON.parse(postsJSON) : [];
            }
            
            // 保存帖子到本地存储
            function savePostToLocalStorage(post) {
                const posts = getPostsFromLocalStorage();
                posts.push(post);
                localStorage.setItem('classWallPosts', JSON.stringify(posts));
            }
            
            // 返回加载帖子的函数，供外部调用
            return {
                loadPosts: loadPosts
            };
        }
        
        // 通知功能
        function setupNotifications() {
            // 标记全部已读
            const markAllReadBtn = document.getElementById('mark-all-read');
            if (markAllReadBtn) {
                markAllReadBtn.addEventListener('click', function() {
                    const notificationItems = document.querySelectorAll('.notification-item');
                    notificationItems.forEach(item => {
                        item.style.opacity = '0.7';
                    });
                    showMessage('所有通知已标记为已读！', 'success');
                });
            }
            
            // 发布通知
            const notificationForm = document.getElementById('notification-form');
            if (notificationForm) {
                notificationForm.addEventListener('submit', function(e) {
                    e.preventDefault();
                    
                    const title = document.getElementById('notification-title').value;
                    const content = document.getElementById('notification-content').value;
                    const type = document.getElementById('notification-type').value;
                    
                    if (!title || !content) {
                        showMessage('请填写完整的通知信息！', 'error');
                        return;
                    }
                    
                    // 创建新通知
                    createNotification({
                        id: Date.now(),
                        title: title,
                        content: content,
                        type: type,
                        date: new Date()
                    });
                    
                    // 清空表单
                    notificationForm.reset();
                    
                    // 保存到本地存储
                    saveNotificationToLocalStorage({
                        id: Date.now(),
                        title: title,
                        content: content,
                        type: type,
                        date: new Date()
                    });
                    
                    showMessage('通知发布成功！', 'success');
                });
            }
            
            // 创建通知DOM元素
            function createNotification(notification) {
                const notificationsList = document.getElementById('notifications-list');
                
                const notificationElement = document.createElement('div');
                notificationElement.className = `notification-item ${notification.type === 'important' ? 'important' : notification.type === 'urgent' ? 'urgent' : ''}`;
                
                const date = new Date(notification.date);
                const formattedDate = `${date.getFullYear()}-${(date.getMonth()+1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
                
                const typeText = notification.type === 'important' ? '重要' : notification.type === 'urgent' ? '紧急' : '一般';
                
                notificationElement.innerHTML = `
                    <div class="notification-header">
                        <div>
                            <span class="notification-tag ${notification.type}">${typeText}</span>
                            <span class="notification-title">${notification.title}</span>
                        </div>
                        <span class="notification-date">${formattedDate}</span>
                    </div>
                    <div class="notification-content">${notification.content}</div>
                `;
                
                // 添加到列表顶部
                notificationsList.insertBefore(notificationElement, notificationsList.firstChild);
            }
            
            // 加载通知
            function loadNotifications() {
                const notificationsList = document.getElementById('notifications-list');
                notificationsList.innerHTML = '';
                
                // 从本地存储获取通知
                const notifications = getNotificationsFromLocalStorage();
                
                // 按时间倒序排列
                notifications.sort((a, b) => new Date(b.date) - new Date(a.date));
                
                // 渲染通知
                notifications.forEach(notification => {
                    createNotification(notification);
                });
            }
            
            // 从本地存储获取通知
            function getNotificationsFromLocalStorage() {
                const notificationsJSON = localStorage.getItem('classNotifications');
                return notificationsJSON ? JSON.parse(notificationsJSON) : [];
            }
            
            // 保存通知到本地存储
            function saveNotificationToLocalStorage(notification) {
                const notifications = getNotificationsFromLocalStorage();
                notifications.push(notification);
                localStorage.setItem('classNotifications', JSON.stringify(notifications));
            }
            
            // 返回加载通知的函数，供外部调用
            return {
                loadNotifications: loadNotifications
            };
        }
        
        // 学习资料功能
        function setupResources() {
            const addResourceBtn = document.getElementById('add-resource-btn');
            const resourceModal = document.getElementById('resource-modal');
            const resourceForm = document.getElementById('resource-form');
            const closeModalBtn = document.querySelector('.close-modal');
            const cancelResourceBtn = document.getElementById('resource-cancel-btn');
            const fileUploadArea = document.getElementById('file-upload-area');
            const resourceFile = document.getElementById('resource-file');
            const fileInfo = document.getElementById('file-info');
            
            // 打开添加资源模态框
            if (addResourceBtn) {
                addResourceBtn.addEventListener('click', function() {
                    document.getElementById('resource-modal-title').textContent = '添加学习资料';
                    document.getElementById('resource-id').value = '';
                    resourceForm.reset();
                    fileInfo.innerHTML = '';
                    resourceModal.style.display = 'flex';
                });
            }
            
            // 关闭模态框
            function closeModal() {
                resourceModal.style.display = 'none';
            }
            
            if (closeModalBtn) {
                closeModalBtn.addEventListener('click', closeModal);
            }
            
            if (cancelResourceBtn) {
                cancelResourceBtn.addEventListener('click', closeModal);
            }
            
            // 点击模态框外部关闭
            window.addEventListener('click', function(e) {
                if (e.target === resourceModal) {
                    closeModal();
                }
            });
            
            // 文件上传区域点击事件
            fileUploadArea.addEventListener('click', function() {
                resourceFile.click();
            });
            
            // 文件选择事件
            resourceFile.addEventListener('change', function() {
                if (this.files.length > 0) {
                    const file = this.files[0];
                    fileInfo.innerHTML = `
                        <p><strong>文件名:</strong> ${file.name}</p>
                        <p><strong>大小:</strong> ${(file.size / 1024).toFixed(2)} KB</p>
                        <p><strong>类型:</strong> ${file.type}</p>
                    `;
                }
            });
            
            // 拖放功能
            fileUploadArea.addEventListener('dragover', function(e) {
                e.preventDefault();
                this.style.borderColor = 'var(--primary-color)';
                this.style.backgroundColor = 'rgba(0, 86, 166, 0.05)';
            });
            
            fileUploadArea.addEventListener('dragleave', function() {
                this.style.borderColor = '#ddd';
                this.style.backgroundColor = 'transparent';
            });
            
            fileUploadArea.addEventListener('drop', function(e) {
                e.preventDefault();
                this.style.borderColor = '#ddd';
                this.style.backgroundColor = 'transparent';
                
                if (e.dataTransfer.files.length > 0) {
                    resourceFile.files = e.dataTransfer.files;
                    const file = e.dataTransfer.files[0];
                    fileInfo.innerHTML = `
                        <p><strong>文件名:</strong> ${file.name}</p>
                        <p><strong>大小:</strong> ${(file.size / 1024).toFixed(2)} KB</p>
                        <p><strong>类型:</strong> ${file.type}</p>
                    `;
                }
            });
            
            // 提交资源表单
            if (resourceForm) {
                resourceForm.addEventListener('submit', async function(e) {
                    e.preventDefault();
                    
                    const id = document.getElementById('resource-id').value;
                    const name = document.getElementById('resource-name').value;
                    const description = document.getElementById('resource-description').value;
                    const subject = document.getElementById('resource-subject').value;
                    const uploader = document.getElementById('resource-uploader').value;
                    const category = document.getElementById('resource-category').value;
                    const file = resourceFile.files[0];
                    
                    if (!name || !description || !subject || !uploader) {
                        showMessage('请填写完整的资料信息！', 'error');
                        return;
                    }
                    
                    let fileData = null;
                    if (file) {
                        try {
                            fileData = await handleFileUpload(file);
                        } catch (error) {
                            showMessage('文件上传失败，请重试！', 'error');
                            return;
                        }
                    }
                    
                    const resourceData = {
                        id: id || Date.now(),
                        name: name,
                        description: description,
                        subject: subject,
                        uploader: uploader,
                        category: category,
                        date: new Date(),
                        file: fileData
                    };
                    
                    if (id) {
                        // 编辑现有资源
                        updateResource(resourceData);
                    } else {
                        // 添加新资源
                        createResource(resourceData);
                    }
                    
                    closeModal();
                });
            }
            
            // 处理文件上传
            function handleFileUpload(file) {
                return new Promise((resolve, reject) => {
                    const reader = new FileReader();
                    reader.onload = function(e) {
                        // 将文件内容保存到localStorage
                        const fileData = {
                            name: file.name,
                            type: file.type,
                            size: file.size,
                            content: e.target.result,
                            uploadDate: new Date()
                        };
                        
                        resolve(fileData);
                    };
                    reader.onerror = reject;
                    reader.readAsDataURL(file);
                });
            }
            
            // 创建资源
            function createResource(resource) {
                // 保存到本地存储
                saveResourceToLocalStorage(resource);
                
                // 重新加载资源
                loadResources();
                
                showMessage('学习资料添加成功！', 'success');
            }
            
            // 更新资源
            function updateResource(resource) {
                const resources = getResourcesFromLocalStorage();
                const resourceIndex = resources.findIndex(r => r.id == resource.id);
                
                if (resourceIndex !== -1) {
                    resources[resourceIndex] = resource;
                    localStorage.setItem('classResources', JSON.stringify(resources));
                    loadResources();
                    showMessage('学习资料更新成功！', 'success');
                }
            }
            
            // 创建资源DOM元素
            function createResourceElement(resource) {
                const resourceElement = document.createElement('div');
                resourceElement.className = 'resource-item';
                resourceElement.setAttribute('data-category', resource.category);
                resourceElement.setAttribute('data-id', resource.id);
                
                const date = new Date(resource.date);
                const formattedDate = `${date.getFullYear()}-${(date.getMonth()+1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
                
                const categoryText = resource.category === 'course' ? '课程资料' : 
                                   resource.category === 'exam' ? '考试资料' : '项目资料';
                
                let fileInfoHtml = '';
                if (resource.file) {
                    fileInfoHtml = `
                        <div class="resource-meta">
                            <span><i class="fas fa-file"></i> ${resource.file.name}</span>
                            <span>${(resource.file.size / 1024).toFixed(2)} KB</span>
                        </div>
                    `;
                }
                
                resourceElement.innerHTML = `
                    <h4>${resource.name}</h4>
                    <p>${resource.description}</p>
                    <div class="resource-meta">
                        <span>科目: ${resource.subject}</span>
                        <span>上传: ${resource.uploader}</span>
                    </div>
                    <div class="resource-meta">
                        <span>日期: ${formattedDate}</span>
                        <span class="resource-type">${categoryText}</span>
                    </div>
                    ${fileInfoHtml}
                    <div class="resource-actions">
                        <button class="btn btn-small edit-resource">编辑</button>
                        <button class="btn btn-small btn-outline delete-resource">删除</button>
                        ${resource.file ? '<button class="btn btn-small download-resource">下载</button>' : ''}
                    </div>
                `;
                
                // 添加事件监听器
                const editBtn = resourceElement.querySelector('.edit-resource');
                editBtn.addEventListener('click', function() {
                    editResource(resource.id);
                });
                
                const deleteBtn = resourceElement.querySelector('.delete-resource');
                deleteBtn.addEventListener('click', function() {
                    deleteResource(resource.id);
                });
                
                if (resource.file) {
                    const downloadBtn = resourceElement.querySelector('.download-resource');
                    downloadBtn.addEventListener('click', function() {
                        downloadResource(resource);
                    });
                }
                
                return resourceElement;	
            }
            
            // 下载资源
            function downloadResource(resource) {
                if (resource.file) {
                    const link = document.createElement('a');
                    link.href = resource.file.content;
                    link.download = resource.file.name;
                    link.click();
                }
            }
            
            // 编辑资源
            function editResource(resourceId) {
                const resources = getResourcesFromLocalStorage();
                const resource = resources.find(r => r.id == resourceId);
                
                if (resource) {
                    document.getElementById('resource-modal-title').textContent = '编辑学习资料';
                    document.getElementById('resource-id').value = resource.id;
                    document.getElementById('resource-name').value = resource.name;
                    document.getElementById('resource-description').value = resource.description;
                    document.getElementById('resource-subject').value = resource.subject;
                    document.getElementById('resource-uploader').value = resource.uploader;
                    document.getElementById('resource-category').value = resource.category;
                    
                    if (resource.file) {
                        fileInfo.innerHTML = `
                            <p><strong>文件名:</strong> ${resource.file.name}</p>
                            <p><strong>大小:</strong> ${(resource.file.size / 1024).toFixed(2)} KB</p>
                            <p><strong>类型:</strong> ${resource.file.type}</p>
                        `;
                    } else {
                        fileInfo.innerHTML = '';
                    }
                    
                    resourceModal.style.display = 'flex';
                }
            }
            
            // 删除资源
            function deleteResource(resourceId) {
                if (confirm('确定要删除这个学习资料吗？')) {
                    const resources = getResourcesFromLocalStorage();
                    const filteredResources = resources.filter(r => r.id != resourceId);
                    
                    localStorage.setItem('classResources', JSON.stringify(filteredResources));
                    loadResources();
                    showMessage('学习资料删除成功！', 'success');
                }
            }
            
            // 加载资源
            function loadResources() {
                const resourcesList = document.getElementById('resources-list');
                resourcesList.innerHTML = '';
                
                // 从本地存储获取资源
                const resources = getResourcesFromLocalStorage();
                
                // 按时间倒序排列
                resources.sort((a, b) => new Date(b.date) - new Date(a.date));
                
                // 渲染资源
                resources.forEach(resource => {
                    const resourceElement = createResourceElement(resource);
                    resourcesList.appendChild(resourceElement);
                });
            }
            
            // 从本地存储获取资源
            function getResourcesFromLocalStorage() {
                const resourcesJSON = localStorage.getItem('classResources');
                return resourcesJSON ? JSON.parse(resourcesJSON) : [];
            }
            
            // 保存资源到本地存储
            function saveResourceToLocalStorage(resource) {
                const resources = getResourcesFromLocalStorage();
                resources.push(resource);
                localStorage.setItem('classResources', JSON.stringify(resources));
            }
            
            // 返回加载资源的函数，供外部调用
            return {
                loadResources: loadResources
            };
        }
        
        // 数据管理功能
        function setupDataManagement() {
            const exportDataBtn = document.getElementById('export-data-btn');
            const importDataBtn = document.getElementById('import-data-btn');
            const importFile = document.getElementById('import-file');
            
            // 导出数据
            exportDataBtn.addEventListener('click', function() {
                exportData();
            });
            
            // 导入数据
            importDataBtn.addEventListener('click', function() {
                importFile.click();
            });
            
            importFile.addEventListener('change', function() {
                if (this.files.length > 0) {
                    importData(this.files[0]);
                }
            });
            
            // 显示统计信息
            showStatistics();
        }
        
        // 导出数据
        function exportData() {
            const data = {
                posts: JSON.parse(localStorage.getItem('classWallPosts')) || [],
                notifications: JSON.parse(localStorage.getItem('classNotifications')) || [],
                resources: JSON.parse(localStorage.getItem('classResources')) || [],
                exportDate: new Date()
            };
            
            const dataStr = JSON.stringify(data, null, 2);
            const dataBlob = new Blob([dataStr], {type: 'application/json'});
            
            const link = document.createElement('a');
            link.href = URL.createObjectURL(dataBlob);
            link.download = `class_data_${new Date().toISOString().split('T')[0]}.json`;
            link.click();
            
            showMessage('数据导出成功！', 'success');
        }
        
        // 导入数据
        function importData(file) {
            const reader = new FileReader();
            reader.onload = function(e) {
                try {
                    const data = JSON.parse(e.target.result);
                    
                    if (data.posts) localStorage.setItem('classWallPosts', JSON.stringify(data.posts));
                    if (data.notifications) localStorage.setItem('classNotifications', JSON.stringify(data.notifications));
                    if (data.resources) localStorage.setItem('classResources', JSON.stringify(data.resources));
                    
                    showMessage('数据导入成功！', 'success');
                    location.reload();
                } catch (error) {
                    showMessage('数据导入失败，文件格式不正确！', 'error');
                }
            };
            reader.readAsText(file);
        }
        
        // 显示统计信息
        function showStatistics() {
            const posts = JSON.parse(localStorage.getItem('classWallPosts')) || [];
            const notifications = JSON.parse(localStorage.getItem('classNotifications')) || [];
            const resources = JSON.parse(localStorage.getItem('classResources')) || [];
            
            const stats = {
                totalPosts: posts.length,
                totalNotifications: notifications.length,
                totalResources: resources.length,
                activeUsers: new Set(posts.map(p => p.author)).size
            };
            
            // 显示统计信息
            document.getElementById('stats-container').innerHTML = `
                <div class="stats-grid">
                    <div class="stat-item">
                        <h3>${stats.totalPosts}</h3>
                        <p>班级墙帖子</p>
                    </div>
                    <div class="stat-item">
                        <h3>${stats.totalNotifications}</h3>
                        <p>通知数量</p>
                    </div>
                    <div class="stat-item">
                        <h3>${stats.totalResources}</h3>
                        <p>学习资料</p>
                    </div>
                    <div class="stat-item">
                        <h3>${stats.activeUsers}</h3>
                        <p>活跃用户</p>
                    </div>
                </div>
            `;
        }
        
        // 通知推送功能
        function setupPushNotifications() {
            const sendPushBtn = document.getElementById('send-push-btn');
            
            sendPushBtn.addEventListener('click', function() {
                const title = document.getElementById('push-title').value;
                const body = document.getElementById('push-body').value;
                
                if (!title || !body) {
                    showMessage('请输入推送标题和内容！', 'error');
                    return;
                }
                
                showNotification(title, body);
                showMessage('推送通知已发送！', 'success');
            });
        }
        
        // 请求通知权限
        function requestNotificationPermission() {
            if ('Notification' in window) {
                Notification.requestPermission().then(permission => {
                    if (permission === 'granted') {
                        console.log('通知权限已授予');
                    }
                });
            }
        }
        
        // 显示通知
        function showNotification(title, body) {
            if ('Notification' in window && Notification.permission === 'granted') {
                new Notification(title, {
                    body: body,
                    icon: '/favicon.ico'
                });
            }
        }
        
        // 加载示例数据
        function loadSampleData() {
            // 检查本地存储是否已有帖子
            const existingPosts = localStorage.getItem('classWallPosts');
            
            if (!existingPosts) {
                // 添加示例帖子
                const samplePosts = [
                    {
                        id: 1,
                        author: '袁聪',
                        content: '今天的高数课有点难，有没有同学可以分享一下笔记？',
                        date: new Date('2023-09-15T10:30:00'),
                        likes: 5,
                        isLiked: false,
                        wallType: 'real',
                        comments: [
                            {
                                id: 101,
                                author: '禹嘉盛',
                                content: '我有详细的笔记，晚点发给你',
                                date: new Date('2023-09-15T11:20:00')
                            },
                            {
                                id: 102,
                                author: '郭浩宇',
                                content: '我也有一些补充资料，可以一起分享',
                                date: new Date('2023-09-15T14:45:00')
                            }
                        ]
                    },
                    {
                        id: 2,
                        author: '匿名用户',
                        content: '食堂的糖醋排骨今天真好吃，强烈推荐！',
                        date: new Date('2023-09-14T12:15:00'),
                        likes: 12,
                        isLiked: false,
                        wallType: 'anonymous',
                        comments: [
                            {
                                id: 201,
                                author: '同学',
                                content: '真的吗？明天我也要去尝尝！',
                                date: new Date('2023-09-14T13:30:00')
                            }
                        ]
                    }
                ];
                
                localStorage.setItem('classWallPosts', JSON.stringify(samplePosts));
            }
            
            // 检查本地存储是否已有通知
            const existingNotifications = localStorage.getItem('classNotifications');
            
            if (!existingNotifications) {
                // 添加示例通知
                const sampleNotifications = [
                    {
                        id: 1,
                        title: '期末考试安排通知',
                        content: '本学期期末考试将于2024年1月8日至1月15日进行，具体考试安排已发布在教学管理系统中，请同学们及时查看并做好复习准备。',
                        type: 'urgent',
                        date: new Date('2023-12-15T09:00:00')
                    },
                    {
                        id: 2,
                        title: '寒假放假安排',
                        content: '根据校历安排，本学期寒假将于2024年1月20日开始，2月25日结束。2月26日正式开学，请同学们合理安排假期时间。',
                        type: 'important',
                        date: new Date('2023-12-10T10:30:00')
                    },
                    {
                        id: 3,
                        title: '班级团建活动通知',
                        content: '为增进同学之间的友谊，班级将于12月20日组织一次团建活动，地点为三江校区体育馆，请同学们踊跃参加。',
                        type: 'normal',
                        date: new Date('2023-12-05T14:15:00')
                    }
                ];
                
                localStorage.setItem('classNotifications', JSON.stringify(sampleNotifications));
            }
            
            // 检查本地存储是否已有学习资料
            const existingResources = localStorage.getItem('classResources');
            
            if (!existingResources) {
                // 添加示例学习资料
                const sampleResources = [
                    {
                        id: 1,
                        name: '电路分析基础笔记',
                        description: '包含电路分析课程的重点知识点总结和典型例题解析。',
                        subject: '电路分析',
                        uploader: '袁聪',
                        category: 'course',
                        date: new Date('2023-10-15T09:00:00')
                    },
                    {
                        id: 2,
                        name: '信号与系统期末复习题',
                        description: '历年信号与系统期末考试真题及详细解答，适合考前复习。',
                        subject: '信号与系统',
                        uploader: '禹嘉盛',
                        category: 'exam',
                        date: new Date('2023-11-20T14:30:00')
                    },
                    {
                        id: 3,
                        name: '嵌入式系统项目报告',
                        description: '基于STM32的智能家居控制系统设计与实现项目完整报告。',
                        subject: '嵌入式系统',
                        uploader: '郭浩宇',
                        category: 'project',
                        date: new Date('2023-12-05T16:45:00')
                    }
                ];
                
                localStorage.setItem('classResources', JSON.stringify(sampleResources));
            }
            
            // 加载帖子、通知和资源
            const wall = setupWall();
            wall.loadPosts();
            
            const notifications = setupNotifications();
            notifications.loadNotifications();
            
            const resources = setupResources();
            resources.loadResources();
        }
        
        // 平滑滚动
        function setupSmoothScroll() {
            const navLinks = document.querySelectorAll('nav a');
            
            navLinks.forEach(link => {
                link.addEventListener('click', function(e) {
                    const targetId = this.getAttribute('href');
                    
                    // 仅对锚点链接阻止默认行为并执行平滑滚动
                    if (targetId.startsWith('#')) {
                        e.preventDefault();
                        const targetElement = document.querySelector(targetId);
                        if (targetElement) {
                            window.scrollTo({
                                top: targetElement.offsetTop - 80,
                                behavior: 'smooth'
                            });
                        }
                    }
                    // 对于非锚点链接（如指向其他HTML文件的链接），不阻止默认行为
                });
            });
        }
    </script>
    


</body>
</html>
